<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="${CONTEXT}/view/css/import.css"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
<title>バッチ状況照会</title>
</head>

<body id="layres">
<div class="layreshdr">
	<div>
	<ul>
		<li><a href="menu.do">メニュー</a></li>
		<li><a href="logoff.do">ログオフ</a></li>
	</ul>
	</div>
	<div>
		バッチ状況
	</div>

	<div id="topMessage">${MESSAGE}</div>
</div>
<div class="layresmaj">
	<div class="layrespri">
		<c:if test="${fn:length(array.PatternValue) gt 0}">
		<form id="pattern" method="get" action="${ACTION_PATH}">
		<div>
			<label>検索パターン:</label>
			<select name="PatternId">
			<option></option>
			<c:forEach items="${band.PatternValue}" var="bind">
				<utl:select var="sel" name="PatternId" value="${bind.PatternValue}" />
				<option value="${sel}">${bind.PatternLabel}</option>
			</c:forEach>
			</select>
			<button type="button" class="search">検索</button>
			<button type="button" class="csv">CSV</button>
		</div>

		<div>
			<a href="javascript:void(0);" class="detail">詳細検索</a>
		</div>
		</form>
		</c:if>

		<div id="detail">
		<form id="search" method="get" action="${ACTION_PATH}">
			<label>ユーザID:</label>
			<input type="text" name="UserIdSearch" value="${UserIdSearch}"/>
			<button type="submit">検索</button>
			<button type="button" class="csv">CSV</button>
		</form>

		<c:if test="${fn:length(REQUEST_QUERY) gt 0}">
		<form id="register" method="post">
			<div>検索パターン登録</div>
			<div>
				<input type="hidden" name="PatternQuery" value="${RESPONSE_QUERY}" />
				<input type="text" name="PatternName" maxlength="64" />
				<input id="defaultPattern" type="checkbox" name="DefaultPattern" />
				<label for="defaultPattern">優先</label>
				<button type="button" class="register">パターン登録</button>
			</div>
		</form>
		</c:if>
		</div>

		<div>
			<c:if test="${not empty JobMei}" >
			<div>${Cnt}&nbsp;件</div>
			<tags:paginator/>
			<div>
				<table width="100%" class="fixborder" >
					<tr>
						<th rowspan="3">No</th>
						<th>処理ID</th>
						<th>処理名称</th>
						<th>受付日時</th>
						<th>依頼者</th>
						<th rowspan="3">処理状況</th>
					</tr>
					<tr>
						<th colspan="4">指示内容</th>
					</tr>
					<tr>
						<th colspan="4">メッセージ</th>
					</tr>
					<c:forEach begin="0" items="${band.JobMei}" var="bind" varStatus="i">
					<tr class=" ${(i.count mod 2) eq 0 ? 'even' : 'odd'}">
						<td rowspan="3" align="center">
							${i.count + ((Page - 1) * Line)}
						</td>
						<td>
<!--
							<utl:param var="prm" name="Page,JobSeq,PatternId" value="${Page},${bind.JobSeq}," />
-->
							<utl:param var="prm" name="JobSeq" value="${bind.JobSeq}" />
							<a href="${DETAIL_PATH}?${prm}">${bind.JobId}</a>
						</td>
						<td align="center">
							<c:set var="val" value="${empty bind.JobMei ? '-' : bind.JobMei}" />
							${val}
						</td>
						<td align="center">
							<c:set var="val" value="${empty bind.TorokuDtm ? '-' : bind.TorokuDtm}" />
							${val}
						</td>
						<td align="center">
							<c:set var="val" value="${empty bind.UserId ? '-' : bind.UserId}" />
							${val}
						</td>
						<td rowspan="3" align="center">
							<tags:state var="val" value="${bind.JobSts}"/>
							${val}
							<c:if test="${(bind.JobSts lt 40) and (bind.CancelType eq '1')}">
								<form id="form${i.index}" method="post">
								<input type="hidden" name="JobSeq" value="${bind.JobSeq}" />
<!--
									<button type="button" class="cancel">中止</button>
-->
								<button type="submit" name="AID" value="cancel">中止</button>
								</form>
							</c:if>
						</td>
					</tr>
					<tr class=" ${(i.count mod 2) eq 0 ? 'even' : 'odd'}">
						<td colspan="4" align="center">
							<c:set var="val" value="${empty bind.GamenPrm ? '-' : bind.GamenPrm}" />
							${val}
						</td>
					</tr>
					<tr class=" ${(i.count mod 2) eq 0 ? 'even' : 'odd'}">
						<td colspan="4" align="center">
							<c:set var="val" value="${empty bind.MsgTxt ? '-' : bind.MsgTxt}" />
							${val}
						</td>
					</tr>
					</c:forEach>
				</table>
			</div>
			</c:if>
		</div>
	</div>
	<div class="layressec">
	</div>
	<div class="layrester">
	</div>
</div>
<div class="layresftr">
	<div class="layresftr1">
	</div>
	<div class="layresftr2">
	</div>
</div>

<script src="${CONTEXT}/view/js/jquery.min.js"></script>
<script src="${CONTEXT}/view/js/opt/jquery.jstore-all.min.js"></script>
<script src="${CONTEXT}/view/js/submit.js"></script>
<script>
//<![CDATA[
jQuery.jStore.FindEngine();
$(document).ready(function() {
	$('#register').submit(function(ev){ev.preventDefault();});
	$('a.detail').click(function(ev){$('#detail').toggle('fast');ev.preventDefault();});
	$('button.csv').click(function(){VIEW.submit.get($(this).closest('form').attr('id'), 'STATUSCSV/${PATH}.csv');});
	$('button.cancel').click(function(){VIEW.submit.post($(this).closest('form').attr('id'), 'cancel');});
	$('button.register').click(function(){VIEW.submit.post('register', 'RegisterPattern');});
	$('button.search').click(function(){VIEW.submit.get($(this).closest('form').attr('id'));});
});
//]]>
</script>
</body>
</html>
